﻿@*{{log this}}*@
{{#if controller.isPhoto}}
	{{#each controller.docs}}
	<li class="ui-widget-content ui-corner-tr photo" {{bindAttr data-doc-id="docID" }}>

		<div  class="photo-image">
		{{#if hasThumb}}
			<a data-gallery="gallery" {{bindAttr href="urlDoc" }}>
			<img {{bindAttr src="urlThumb"}}  alt="thumb"/>
			</a>
		{{else}}
			<i {{bindAttr class="fileIcon" }} ></i>
		{{/if}}
		</div>
				
		{{#if this.editMode}}
			<div class="ExtendIt" style="margin:0">
				<input class="description" type="text" {{bindAttr value="description"}} style="width:100%;margin-bottom:5px;height:26px;"/>
				<input class="docType" type="text" style="height:26px;margin-bottom:5px;" {{bindAttr value="docType"}}/>
				
				<div class="clearfix pad-b5">
					<button {{action SaveEditedDoc this target="App.editDocsController"}} class="btn small pull-left">Išsaugoti</button>
					<a {{action cancelSaveDoc this target="App.editDocsController"}} class="margin-vert7 pull-right">Atšaukti</a>
				</div>

			</div>
		{{else}}
			<div class="text-dgray lheight16 pad-b4">{{description}}</div>
			<a {{bindAttr href="urlDoc" }} class="word-break" target="_blank">{{fileName}}</a>
			<p class="pad-bot0">{{userName}}&nbsp;{{fileDate}}</p>
			<div class="w100px">
				<i class="img32-mono_edit clickable" {{action editDoc this target="App.editDocsController"}}></i>
				<i class="img32-mono_delete clickable" {{action deleteDoc this target="App.editDocsController"}}></i>
			</div>
		{{/if}}

	</li>
	{{/each}}
{{else}}

	{{#each controller.docs}}
	<li class="docs relative" {{bindAttr data-doc-id="docID" }}>
		<div class="tr">
			<div class="td img" style="width:60px;">
					{{#if hasThumb}}
						<img {{bindAttr src="urlThumb"}} alt="thumb"/>
					{{else}}
						<i {{bindAttr class="fileIcon" }} ></i>
					{{/if}}
			</div>

			{{#if this.editMode}}

				<div class="clearfix">

					<div class="td col five ExtendIt">
						<input class="docType" type="text" style="height:26px;" {{bindAttr value="docType"}}/><br/>
						<!-- <a {{bindAttr href="urlDoc"}} target="_blank" >{{fileName}}</a> -->
					</div>

					<div class="td col seven pad-r100 margin-l2pr">
						<input class="description" type="text" {{bindAttr value="description"}} style="width:100%;height:26px;"/>
						<!-- <p>{{docDetails}}</p> -->
					</div>

					<div class="td block-buttons absolute-right">
						<button {{action SaveEditedDoc this target="App.editDocsController"}} class="btn small">Išsaugoti</button>
						<a {{action cancelSaveDoc this target="App.editDocsController"}}>Atšaukti</a>
					</div>

				</div>

			{{else}}

				<div class="td">

					<div class="tr">

						<div class="td"><span class="text-dgray bold">{{docType}}</span></div>
						<div class="td"><span class="text-dgray mheight20">{{description}}</span></div>

					</div>

					<div class="tr">

						<div class="td"><a class="pad-t4" {{bindAttr href="urlDoc"}} target="_blank" >{{fileName}}</a></div>
						<div class="td"><span class="font10">{{docDetails}}</span></div>

					</div>

				</div>

				<div class="td" style="width:32px;">
					<i class="img32-mono_edit clickable" {{action editDoc this target="App.editDocsController"}}></i>
				</div>

				<div class="td" style="width:32px;">
					<i class="img32-mono_delete clickable" {{action deleteDoc this target="App.editDocsController"}}></i>
				</div>

			{{/if}}
		</div><!-- tr -->
	</li>
	{{/each}}

{{/if}}
